﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PKURG.CostSplit.Business.QueryBase;

namespace PKURG.CostSplit.Business
{
    public class ERPAccount
    {

        public static IList<Entities.ErpAccount> GetAllAccount()
        {
            return new Services.ErpAccountService().GetAll();
        }

        public static Entities.ErpAccount GetAccountInfo(int accountId)
        {
            return new Services.ErpAccountService().GetById(accountId);
        }

        public static Entities.ErpAccount GetAccountInfoByName(string accountName)
        {
            IList<Entities.ErpAccount> infos= new Services.ErpAccountService().Find(string.Format("Name='{0}'", accountName));
            return infos.Count == 0 ? null : infos[0];
        }
        //public static List<dynamic> GetAllAccount()
        //{
        //    return ExecuteQuery.GetList(
        //        new QueryBase.QueryInfo()
        //        {
        //            ProcName = "usp_GetProjectStageInfo",
        //            Params = {  }
        //        });
        //}
    }
}
